Conversation
QualityReport.to_markdown() escaped only the description cell, so a column name containing "|" added an extra cell and shifted the Actions row, and newlines in any cell split the row. Escape every cell inside _md_table_row instead: "|" becomes "\|" and line breaks become "<br>". The manual per-description escape is removed so values are no longer double-escaped. Fixes FreshCode-Org#338
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks! The fix looks good. I ran One small thing before it can merge: #350 was just merged and also added a bullet at the top of |
|
Thank you @cnYui for this fix! Your branch needed a rebase onto current |
Problem
In the Actions table of
QualityReport.to_markdown(), only the descriptioncell was escaped. A column named
a|btherefore added an extra cell andshifted the whole row, and a newline in any cell split the row. This breaks the
rendered table (issue #338).
Reproduction on
main:Fix
_md_table_rowvia a small_md_escape_cellhelper:
|becomes\|, and\r\n/\r/\nbecome<br>.a.description.replace("|", "\|")at the call siteso values are no longer double-escaped.
The separator/header rows contain no pipes or newlines, so their rendering is
unchanged.
Tests
test_md_table_row_escapes_pipe_and_newline— unit-covers pipe escaping andbare-
\r, CRLF and\nline breaks.test_quality_report_actions_table_survives_pipe_in_column_name— regressionfor QualityReport.to_markdown breaks the Actions table when a column name contains '|' #338: every Actions row keeps the header's column count and shows
a\|b.Verification (run locally)
pytest -m "not online and not large"— coverage gate reached (93.21%); theonly failures are 3 pre-existing, unrelated tests (
performance/test_runner_cli,test_experimental_ai_copilot,test_semantic_backends) that also fail on anunmodified
mainin this environment.pytest tests/test_enterprise_metrics.py --no-cov— all pass.ruff check .— clean.I also added a note under
Unreleased → FixedinCHANGELOG.md.